package com.help10000.rms.mvp.presenter

import com.amir.common.api.CustomObserver
import com.amir.common.beans.HomeEntity
import com.amir.common.mvp.model.Model
import com.amir.common.mvp.presenter.BasePresenter
import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.help10000.rms.mvp.view.WorkOrderView

class WorkOrderPresenter(view:WorkOrderView) :BasePresenter<WorkOrderView>(view) {



    fun getData() {

        val token = SPUtils.getString(Constant.AccessToken)

        val homeData = Model.getServer().getHomeData(token)
        Model.getObservable(homeData,object :CustomObserver<HomeEntity>(mvpView){

            override fun success(t: HomeEntity) {
                mvpView?.SuccessData(t.data)
            }
        })
    }


}